<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
	"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>校园宿舍管理系统</title>
<link href="${path }/css/style.css" 
	rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${path }/js/checkForm.js" 
	charset="gb2312"></script>
<meta http-equiv="Content-Type" 
	content="text/html;charset=gb2312"/>
</head>

<body>
<center>
<table class="out">
<tr>
    <td class="title">校园宿舍管理系统</td>
</tr>
<tr>
    <td class="subtitle">&nbsp;</td>
</tr>
<tr>
    <td class="content">
    <table class="out">
    <tr>
        <td class="left" >
        	<%@ include file="left.jsp"%>
     	</td>
     	
        <td class="right">
        <table class="rightTable">
        <tr>
          	<td class="mainMenu">楼宇管理</td>
        </tr>
        <tr>
            <td class="rightout">
            <form name="form1" onsubmit="return checkDomitoryManager()" 
            	method="post" action="searchDomitory.do">		  
            <table class="fullTable">
            <tr>
                <td class="navi"> 
                	功能导航： <a href="preSaveDomitory.do">添加宿舍</a></td>
                <td>查询：
                <select name="bId">
                	<option value="">请选择</option>
	            	<c:forEach items="${buildingList }" var="building">
	            	<option value="${building.id }">${building.name }</option>
	            	</c:forEach>    
	            </select>
                &nbsp;&nbsp;&nbsp;              
                <input name="name" class="text1">
                <input type="submit" value="点击查询"></td>
            </tr>
            </table>
            </form>
            
            <table class="fullTable" >
            <tr class="dataTitleTr">
                <th>名称</th>
                <th>宿舍楼</th>
                <th>操作</th>
            </tr>
            <c:forEach items="${domitoryList }" var="domitory">           
            <tr class="dataTr">
              	<td>${domitory.name}</td>
              	<td>${domitory.building.name}</td>
              	<td>
                	<a href="preSaveDomitory.do?id=${domitory.id}">修改</a> 
                	&nbsp;&nbsp;
                	<a href="deleteDomitory.do?id=${domitory.id}" 
                		onClick="return confirm('确定要删除该宿舍吗？')">删除</a>
              	</td>
            </tr>
            </c:forEach>                                
            </table>
            </td>
        </tr>
        </table>
        </td>
    </tr>
    </table>
    </td>
</tr>
<tr>
    <td class="bottom">&nbsp;</td>
</tr>
</table>
</center>
</body>
</html>